<template>
  <div class="videoList">
    <van-grid :border="false" :column-num="2" v-for="(item,index) in cateList" :key="index">
      <van-grid-item v-for="(info, index) in item.list" :key="index" @click="$router.push('/videodetail/'+ info.id)">
        <van-image :src="info.img" v-if="info.img"/>
        <van-image src="../../../assets/img/avatar.jpg" v-else/>
        <div class="info">
          <p class="desc">{{info.name}}</p>
          <p class="num">
            <span class="play"><i class="far fa-play-circle"></i>375.9万</span
            ><span class="comment"><i class="fas fa-align-left"></i>1.2万</span>
          </p>
        </div>
      </van-grid-item>

      <!-- 静态样式 -->
      <!-- <van-grid-item>
        <van-image src="https://img.yzcdn.cn/vant/apple-3.jpg" />
        <div class="info">
          <p class="desc">
            【毕导】建议收藏！如何在毕业答辩上一展雄风，成为答辩之神！
          </p>
          <p class="num">
            <span class="play"><i class="far fa-play-circle"></i>375.9万</span
            ><span class="comment"><i class="far fa-play-circle"></i>1.2万</span>
          </p>
        </div>
      </van-grid-item> -->
    </van-grid>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {}
  },
  props:{
    cateList:{
      type: Array,
      default(){
        return []
      }
    }
  }
};
</script>
<style lang="less" scoped>
.videoList {
  font-size: 13px;
  .van-image__error,
  .van-image__img,
  .van-image__loading {
    width: 80%;
    margin: 0 auto;
  }

  /deep/.van-grid-item__content{
    padding: 10px 4px 0;
  }

  .van-image{
    height: 114.22px;
  }

  .info {
    width: 100%;
    position: relative;
    .desc {
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      margin-top: 10px;
      line-height: 20px;
      color: #666;
    }
    p.num {
      display: flex;
      justify-content: space-between;
      background: linear-gradient(0deg,rgba(0,0,0,.85),transparent);
      width: 100%;
      height: 25px;
      color: #fff;
      position: absolute;
      left: 0;
      top: -25px;
      box-sizing: border-box;
      padding: 6px;
      i{
        margin-right: 3px;
      }
    }
  }
}
</style>
